﻿using Mes.Domain.BoundedContext.EntityBase;

namespace Mes.Domain.BoundedContext.Entities.Operations
{
    /// <summary>
    /// Defines the flow of produced quantities from one entity for one operation to another
    /// 工序路线（工艺路线对工序步骤关联表，一对多，工序有顺序）
    /// </summary>
    public class StdOperEntRoute : NoIdEntityBase
    {
        /// <summary>
        /// Identify ProcessRoute
        /// </summary>
        public int Process_Route_Id { get; set; }

        /// <summary>
        /// Identify operation for this process
        /// </summary>
        public string Oper_Id { get; set; } = String.Empty;

        /// <summary>
        /// Entity on which operation being done
        /// </summary>
        public int Ent_Id { get; set; }

        /// <summary>
        /// Identify predecessor operation
        /// </summary>
        public string Input_Oper_Id { get; set; } = String.Empty;

        /// <summary>
        /// Identify entity for predecessor operation
        /// </summary>
        public int Input_Ent_Id { get; set; }

        /// <summary>
        /// How much of predecessor?s production comes here 
        /// </summary>
        public float Input_Percent { get; set; }

        /// <summary>
        /// Why record was changed
        /// </summary>
        public string Last_Edit_Comment { get; set; } = String.Empty;

        /// <summary>
        /// Who last changed record
        /// </summary>
        public string Last_Edit_By { get; set; } = String.Empty;

        /// <summary>
        /// When record was last changed
        /// </summary>
        public DateTime Last_Edit_At { get; set; }= DateTime.Now;

        /// <summary>
        /// Changes when modified
        /// </summary>
        public long Mod_Id { get; set; }

        /// <summary>
        /// Unique row identifier, for audit trail
        /// </summary>
        public int Row_Id { get; set; }

        /// <summary>
        /// 加工工序
        /// </summary>
        public int Order { get; set; }
    }
}
